package me.minecraft.plugin.pokemondenyconvert;

import com.cobblemon.mod.common.api.pokemon.PokemonSpecies;
import com.cobblemon.mod.common.pokemon.Species;
import lombok.Getter;
import me.minecraft.plugin.pokemondenyconvert.command.MainCommand;
import me.minecraft.plugin.pokemondenyconvert.config.MainConfig;
import me.minecraft.plugin.pokemondenyconvert.listener.PokemonEvent;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.HashMap;
import java.util.Map;

public final class PokemonDenyConvert extends JavaPlugin {

    @Getter private static PokemonDenyConvert instance;
    @Getter private static MainConfig mainConfig;

    @Override
    public void onEnable() {
        instance = this;
        mainConfig = new MainConfig(this);
        getServer().getPluginManager().registerEvents(new PokemonEvent(), this);
        registerCommand("PokemonDenyConvert", new MainCommand());
    }

    private void registerCommand(String name, CommandExecutor executor) {
        PluginCommand command = getCommand(name);
        if (command == null) {
            getLogger().warning("无法注册命令：" + name);
            return;
        }
        command.setExecutor(executor);
    }

}
